[mirrors]
http://ftp.de.debian.org/debian/pool/main/p/procps/procps_3.3.9.orig.tar.xz
[vars]
filesize=560812
sha512=62c7270aa48b4346a3198f306d1cb8474f64650bfb67e8cc6c4d41923e50c31c95b3a0367a464823fb50a6137ec0c6352006292ac85b50caf730ec8ec35eb553
tardir=procps-ng-3.3.9

[deps]

[build]
cat << EOF > include/error.h
#include <stdio.h>
#include <string.h>
#define HAVE_PROGRAM_INVOCATION_SHORT_NAME
#define PROGRAM_NAME "procps"

#define error(status, errnum, ...) \
  do { fflush(stdout); \
       dprintf(2, PROGRAM_NAME ": "); \
       dprintf(2, __VA_ARGS__); \
       if(errnum) dprintf(2, ": %s", strerror(errnum)); \
       dprintf(2, "\n"); \
       if(status) exit(status); \
  } while(0)

#define error_at_line(status, errnum, fn, line, ...) \
  do { fflush(stdout); \
       dprintf(2, PROGRAM_NAME ": %s:%d", fn, (int) line); \
       dprintf(2, __VA_ARGS__); \
       if(errnum) dprintf(2, ": %s", strerror(errnum)); \
       dprintf(2, "\n"); \
       if(status) exit(status); \
  } while(0)


EOF
mkdir -p include/sys
cat << EOF > include/sys/dir.h
#include <dirent.h>
#define direct dirent
EOF

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

STRIP=true \
CPPFLAGS="-D_GNU_SOURCE -DGLOB_TILDE=0 -DAF_INET6=10 -DAF_INET=2" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --without-ncurses \

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
mv $dest/usr/bin/* $dest/bin/
